
import { director, setDisplayStats } from 'cc';
import { _decorator, Component, Node, assetManager, AssetManager, SceneAsset } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Main')
export class Main extends Component {
    onLoad() {
        setDisplayStats(true);
    }

    onBtnEnterGame() {
        assetManager.loadBundle('ddz', (err, bundle: AssetManager.Bundle) => {
            if (err)
                return console.log(err);
            
            bundle.loadScene('game', (err, scene: SceneAsset) => {
                if (err) 
                    return console.log(err);
                director.runScene(scene);
            })
        })
    }
}
